//
//  CuNavigationBar.m
//  Estate
//
//  Created by heyong on 16/6/13.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "CuNavigationBar.h"

@implementation CuNavigationBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    
    UIView *topView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, DEF_WIDTH(self), 64)];
    topView.backgroundColor=[UIColor colorWithRed:0.22 green:0.64 blue:0.59 alpha:1.00];
    [self addSubview:topView];
    
    //添加返回按钮
    _leftBtn=[[UIButton alloc]init];
    [topView addSubview:_leftBtn];
    [_leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.centerY.mas_equalTo(topView.mas_centerY).mas_offset(10);
        make.width.mas_offset(30);
        make.height.mas_offset(30);
    }];
    [_leftBtn setImage:[UIImage imageNamed:@"fanhui"] forState:UIControlStateNormal];

    _rightBtn=[[UIButton alloc]init];
    [topView addSubview:_rightBtn];
    [_rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(0);
        make.centerY.mas_equalTo(topView.mas_centerY).offset(10);
        make.width.mas_offset(50);
        make.height.mas_offset(50);
    }];
    [_rightBtn setImage:[UIImage imageNamed:@"wancheng"] forState:UIControlStateNormal];

    UILabel *titleLab=[[UILabel alloc]init];
    [topView addSubview:titleLab];
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(topView.mas_centerX);
        make.centerY.mas_equalTo(topView.mas_centerY).mas_offset(10);
        make.width.mas_offset(200);
        make.height.mas_offset(50);
    }];
    titleLab.font=[UIFont systemFontOfSize:18.];
    titleLab.textColor=[UIColor whiteColor];
    titleLab.textAlignment=1;
//    NSLog(@"title:%@",self.title);
    titleLab.text=@"旁站-回填土-物料信息";
}


@end
